
<script setup lang="ts">
const getImageUrl = (user: string) => {
  return new URL(`../assets/images/${user}.png`, import.meta.url).href
}
</script>


<template>
  <el-row class="home" :gutter="20">
    <el-col :span="8" style = "margin-top: 20px">
      <el-card>
        <div class="user">
          <img :src="getImageUrl('user')" class="user"/>
          <div class="user-info">
            <p class="user-info-admin">Admin</p>
            <p class="user-info-p">超级管理员</p>
          </div>
        </div>
        <div class="login-info">
          <p>上次登录时间：<span>2024-01-01 00:00:00</span></p>
          <p>上次登录地点：<span>西安</span></p>
        </div>
      </el-card>
    </el-col>
  </el-row>
</template>




<style scoped lang="less">
.home {
  height: 100%;
  //用于隐藏超出容器边界的内容
  overflow: hidden;
  .user {
    //启用flex布局
    display: flex;
    //垂直居中
    align-items: center;
    //边框
    border-bottom: 1px solid #ccc;
    //间距
    margin-bottom: 20px;
    img{
      width: 150px;
      height: 150px;
      //圆角
      border-radius: 50%;
      margin-right: 40px;
    }
    .user-info {
      p{
        line-height: 40px;
      }
      .user-info-admin {
        font-size: 40px;
      }
      .user-info-p {
        color: #999;
      }
    }
  }
  .login-info {
    p{
      line-height: 30px;
      font-size: 14px;
      color: #999;
      span {
        color: #666;
        margin-left: 60px;
      }
    }
  }
}
</style>
